]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: keep the desktop clone at integral positions tweening it
authorOwen W. Taylor <otaylor@fishsoup.net>
Wed, 15 Aug 2012 23:21:33 +0000 (19:21 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:48 +0000 (21:15 -0400)
Drawing the desktop at non-integral positions is slower because it
turns off the obscured-area clipping logic, so avoid that.

js/ui/messageTray.js

index 8d14d1f4971747bcf35909bbf81263678fd48fd1..f7747166046bfef83e478310d7af4aba8a4e3d00 100644 (file)
@@ -1932,12 +1932,14 @@ const MessageTray = new Lang.Class({
 
         this._lightbox.show();
 
+        this._desktopClone._progress = 0;
         Tweener.addTween(this._desktopClone,
-                         { y: this._desktopClone.y - this.actor.height,
+                         { _progress: this.actor.height,
                            time: ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onUpdate: Lang.bind(this, function() {
-                               let progress = -1 * this._desktopClone.y; // y is negative
+                               let progress = Math.round(this._desktopClone._progress);
+                               this._desktopClone.y = - progress;
                                this._desktopClone.set_clip(geometry.x,
                                                            geometry.y + progress,
                                                            geometry.width,
@@ -1966,8 +1968,9 @@ const MessageTray = new Lang.Class({
         }
 
         let geometry = this._desktopClone.clip;
+        this._desktopClone._progress = 0;
         Tweener.addTween(this._desktopClone,
-                         { y: this._desktopClone.y + this.actor.height,
+                         { _progress: this.actor.height,
                            time: ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onComplete: Lang.bind(this, function() {
@@ -1975,7 +1978,8 @@ const MessageTray = new Lang.Class({
                                this._desktopClone = null;
                            }),
                            onUpdate: Lang.bind(this, function() {
-                               let progress = this.actor.height + this._desktopClone.y; // y is negative
+                               let progress = Math.round(this._desktopClone._progress);
+                               this._desktopClone.y = progress - this.actor.height;
                                this._desktopClone.set_clip(geometry.x,
                                                            geometry.y - progress,
                                                            geometry.width,